Repository navigation
✨ load RAG annotation from file - #476
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The annotation truthiness check silently drops explicitly supplied empty values, allowing a status-only PATCH to activate a document without the intended annotation update instead of rejecting invalid input.
1 open issue
What changed in this PR
Adds file-based loading for RAG annotations in the Python SDK and centralizes input conversion in RagAnnotation.
Changes:
- Accepts dictionaries, JSON strings, bytes, and text or binary file handles.
- Routes PATCH annotation inputs through the shared constructor.
- Adds file-handle test coverage and an explicit integration-test type annotation.
| File | Description |
|---|---|
tests/v2/product/extraction/test_rag_documents.py |
Loads expected annotations from a fixture and tests file-handle input. |
tests/v2/product/extraction/test_rag_documents_integration.py |
Adds an explicit RagAnnotation type annotation. |
mindee/v2/product/extraction/rag_documents/rag_annotation.py |
Adds JSON and file-handle parsing to the annotation constructor. |
mindee/v2/product/extraction/rag_documents/params/rag_document_annotation_parameters.py |
Broadens accepted inputs and delegates conversion to RagAnnotation. |
Review effort: Balanced
ianardee
force-pushed
the
annotation-from-file
branch
2 times, most recently
from
November 20, 2026 12:44
f76db47 to
e436a39
Compare
ianardee
force-pushed
the
annotation-from-file
branch
from
November 20, 2026 13:05
e436a39 to
524ba5d
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The new unit tests require a fixture from the empty tests/data submodule, so the pinned revision must be confirmed to contain test_annotation.json with the expected annotation before merging.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Types of changes